<include file="Public:header" />
<script>
	var module='{$vo.keyword}';
	function addfield(table_name)
	{
	  requesthtml("{:U('addfield')}","table_name="+table_name ,true);
	}
	function editfield(id)
	{
	  requesthtml("{:U('editfield')}","id="+id ,true);
	}
	function delfield(id)
	{
	  confim_del('{$Think.lang.L_ARE_YOU_SURE}','../../delfield/id/'+id+'.html');
	}
	
	function addtable()
	{
		requesthtml("{:U('addtable')}","module_keyword="+module ,true);
	}
	function deltable(id)
	{
		confim_del('{$Think.lang.L_ARE_YOU_SURE}','../../deltable/id/'+id+'.html');
	}
</script>

<ul class="nav nav-pills">
  <li class="active"><a href="{:U("DBManage/module?id=".$vo["id"])}">{$Think.lang.L_MODULE_DB_MANAGE}</a></li>
  <li><a href="{:U("Plugin/module?id=".$vo["id"])}">{$Think.lang.L_PLUGIN_REFRENCE}</a></li>
  <li><a href="{:U("Workflow/index?id=".$vo["id"])}">{$Think.lang.L_WORKFLOW_MANAGE}</a></li>
  <li><a href="{:U("API/module?id=".$vo["id"])}">{$Think.lang.L_API_MANAGE}</a></li>
</ul>
<hr />
<volist name="tblist" id="tblist">
  <h3> {$tblist.table_name} <i class="icon-info-sign" title="{$tblist.note}"></i> </h3>
  <table align="center" class="table table-bordered table-striped">
    <tr>
      <th>{$Think.lang.L_DISPLAYNAME}</th>
      <th>{$Think.lang.L_FIELDNAME}</th>
      <th>{$Think.lang.L_FIELDTYPE}</th>
      <th width="90">{$Think.lang.L_OP}</th>
    </tr>
    <volist name="tblist.fields" id="tbfield">
      <tr align="center">
        <td>{$tbfield.name}
          <eq name="tbfield.index" value="1"><span class="label label-important">{$Think.lang.L_INDEX_PK}</span></eq>
          <eq name="tbfield.index" value="2"><span class="label label-info">{$Think.lang.L_INDEX_HAVE}</span></eq>
          <eq name="tbfield.index" value="3"><span class="label label-info">{$Think.lang.L_UNIQUE_INDEX}</span></eq></td>
        <td>{$tbfield.field}</td>
        <td>{$tbfield.field_type}</td>
        <td><a href="javascript:editfield({$tbfield.id});" ><i class="icon-edit"></i></a>
          <neq name="tbfield.index" value="1"><a href="javascript:delfield({$tbfield.id});" ><i class="icon-remove"></i></a></neq></td>
      </tr>
    </volist>
    <tr>
      <td colspan="6"><a href="javascript:addfield('{$tblist.table_name}');" ><i class="icon-plus"></i></a> <a href="javascript:deltable({$tblist.id});" ><i class="icon-remove"></i></a></td>
    </tr>
  </table>
</volist>
<hr />
<a href="javascript:addtable();"  class="btn btn-primary"> {$Think.lang.L_CREATETABLE}</a> <include file="Public:footer" /> 